let util = require('util');

function Base(name) {
    this.name = name;
}
Base.prototype.say=function (words) {
    console.info(this.name + ' say ' +words);
};
function Sub(age) {
    this.age = age;
}
util.inherits(Sub,Base);
let base = new Base('chen dan');
base.say('hello');

let sub = new Sub(33);
sub.name = 'xiao dan'
sub.say(' i am '+sub.age + ' years old');